<template>
	<view class="unveiling-box">
		<view class="unveiling-top">
			<view class="unveiling-title" @click="getDetail">{{title}}</view>
			<view class="interest-icon" v-if="interestFlag"><uni-icons  type="personadd" color="#3D3D3D" size="15" @click="getAtention"></uni-icons>关注</view>
			<view class="interest-icon" v-if="!interestFlag"><uni-icons  type="personadd-filled" color="#3D3D3D" size="15" @click="getAtention"></uni-icons>取消
			</view>
		</view>
		<view class="unveiling-body">
			<view class="unveiling-text">{{unveilingText}}</view>
			<view class="unveiling-address">
				<view class="address-icon"><uni-icons class="icon-location-filled" type="location-filled" color="#3D3D3D" size="22"></uni-icons>
					{{unveilingAddress}}
				</view>
				<view class="address-tab">
					<uni-tag text="其他" type="success" v-if="showFlag=='其他类'" size="small" custom-style="font-size:19rpx;font-family:'ali';background-color:#00B588;"/>
					<uni-tag text="设计" type="primary" v-if="showFlag=='设计类'" size="small" custom-style="font-size:19rpx;font-family:'ali';background-color:#5590F6;"/>
					<uni-tag text="开发" type="warning" v-if="showFlag=='开发类'" size="small" custom-style="font-size:19rpx;font-family:'ali';background-color:#FF924E;"/>
					</view>
			</view>
			<view class="unveiling-image" v-if="imageUrl">
				<img :src="imageUrl" alt="" style="width: 219rpx; height: 219rpx;"/>
			</view>
		</view>
		<view class="unveiling-foot">
			<view class="unveiling-foot-left">
				<img :src="enterpriceUrl" alt="" style="width: 31rpx;height: 30rpx;" />
			</view>
			<view class="unveiling-foot-right">
				<view class="enterprice-title">{{enterpriceTitle}}</view>
				<view class="enterprice-describe">
					<view class="describe-box" v-for="(item,index) in describeList" :key="index+'describe'">{{item}}

					</view>
				</view>
			</view>
		</view>
		<!-- <view class="underline"></view> -->
	</view>
</template>

<script setup>
	import {
		defineProps,
		defineEmits,
		ref,
		onMounted
	} from "vue";
	const emit = defineEmits(['getDetailData','getAtention'])
	const props = defineProps({
		interestFlag: {
			type: Boolean,
			default: true
		},
		showFlag: {
			type: String,
			default: "其他类"
		},
		id: {
			type: String,
			default: "11111111"
		},
		title: {
			type: String,
			default: "急需600套PCL线板，价可面议"
		},
		unveilingText: {
			type: String,
			default: "因年前仓库泡水，库存的PCL线板报废，急需600套高程3、线宽12的PCL线板（不挑产地，有上海产则更好），价格可面议"
		},
		unveilingAddress: {
			type: String,
			default: "观山湖区毕节路"
		},
		imageUrl: {
			type: String,
			default: ""
		},
		enterpriceUrl: {
			type: String,
			default: "https://minio.gzryzl.com/huatai/2024-11-12/1731398767342enterprice.png"
		},
		enterpriceTitle: {
			type: String,
			default: "贵州辛迪加电子科技有限公司"
		},
		describeList: {
			type: Array,
			default: ['小微企业', '高新技术', '市级专精特新']
		}
	})
function getAtention(){
	console.log(props.id)
	emit('getAtention', props.id)
}
function getDetail() {
		emit('getDetailData', props.id)
	}
	onMounted(()=>{
		console.log(props.showFlag)
	})
</script>

<style scoped lang="less">
	.unveiling-box {
		background-color: #FFFFFF;
		width: 90vw;
		
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		border-bottom: 1rpx solid #dadada;
		padding: 0 40rpx 0 0;
 &:last-of-type{
	 border-bottom: 0rpx solid #dadada;
  }
		.unveiling-top {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 100rpx;

			.unveiling-title {
				font-size: 31.3rpx;
				font-family: "ali";
			}

			.interest-icon {
				font-size: 24rpx;
				font-family: "ali";
				background-color: #F7F8FD;
				padding: 10rpx 20rpx;

				// .van-icon {
				// 	&.alreadyPay {
				// 		color: red;
				// 	}

				// }
			}

		}

		.unveiling-body {
			color: #9B9B9B;
			font-size: 24rpx;
			font-family: "ali";

			.unveiling-address {
				margin: 20rpx 0;
				color: #68696A;
				display: flex;
				align-items: center;
				.address-icon{
					display: flex;
					align-items: center;
				}
				.address-tab {
					padding-left: 10rpx;

					// .van-tag--success {
					// 	background-color: #00B588;
					// }
				}

				// .van-tag--primary {
				// 	background-color: #5590F6;
				// }
			}
		}

		.unveiling-foot {
			display: flex;
			background-color: #F7F8FD;
			margin: 20rpx 0;
			border-radius: 10rpx;
			padding: 10rpx 0;

			.unveiling-foot-left {
				width: 31rpx;
				height: 30rpx;
				margin: 0 10rpx;

			}

			.unveiling-foot-right {
				.enterprice-title {
					margin-bottom: 10rpx;
					color: #272636;
					font-family: "ali";
					font-size: 24rpx;
				}

				.enterprice-describe {
					display: flex;

					.describe-box {
						border: 1rpx solid #5590F6;
						color: #5590F6;
						padding: 5rpx;
						margin-right: 20rpx;
						font-size: 19rpx;
					}
				}
			}
		}

		.underline {
			width: 96vw;
			background-color: #DADADA;
			height: 1rpx;
		}
	}
</style>